import { combineReducers } from 'redux'
import news from './NewsReducer'
import tweet from './TweetReducer'

import * as Constant from '../constants/Constant'

const initialState={
	page:Constant.PAGES.NEWS_LIST_PAGE
}

function commonReducer(state=initialState,action){
	switch(action.type){
		case Constant.CHANGE_PAGE:
			return Object.assign({}, state, {
		        page: action.page
		    })
		default:
			return state
	}
}

const rootReducer = combineReducers({
  commonReducer,
  news,
  tweet
})

export default rootReducer
